Skip to main content

wholeMatches

Type

property

Summary

Specifies whether the lineOffset, wordOffset, and itemOffset functions search only for entire lines, words, or items.

Syntax

set the wholeMatches to {true | false}

Description

Use the wholeMatches property to find lines, words, or items in a container only if what you're searching for matches an entire line, word, or item.

For example, suppose line 6 of a field named "Test" is "additive". The expression lineOffset("add",field "Test") evaluates to 6 if the wholeMatches is false, because "add" is part of the line "additive". If the wholeMatches is true, this function call returns 0 (zero), because "add" does not exactly match the line "additive".

If the wholeMatches property is set to true, the expression

    lineOffset(phrase, container)

is equivalent to the expression

    phrase is among the lines of container

except that the first evaluates to a line number and the second evaluates to true or false. Similarly, the wordOffset and itemOffset functions operate similarly to the is among operator if the wholeMatches property is true.

Since the wholeMatches is a local property, its value is reset to false when the current handler finishes executing. It retains its value only for the current handler, and setting it in one handler does not affect its value in other handlers it calls.

Examples

set the wholeMatches to true

keyword: whole, item, lines, line, words, word, items

operator: is among

property: caseSensitive

command: reset

function: wordOffset, itemOffset, lineOffset, value

glossary: property, return, call, handler, operator, execute, container, function call, function, local property

Compatibility and Support

Introduced

LiveCode 1.0

OS

mac

windows

linux

ios

android

Platforms

desktop

server

mobile

Thank you for your feedback!

Was this page helpful?